import { BroadCastCall } from "../../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../../Framework/MQ/MessageBlock";
import { Cache } from "../../../cache/Cache";
import { SArenaCrossToplists } from "../../../../../Message/Public/SArenaCrossToplists";
import { NetDispatcher } from "../../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../../mvc/ServerCommand";
//class ArenaCrossToplistCommand
    
    export  class ArenaCrossToplistCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            var loc1=Cache.instance;
            var loc2=arg1.messageBase as SArenaCrossToplists;
            if (loc2.process != 0) 
            {
                NetDispatcher.dispatchCmd(ServerCommand.ArenaCrossTopListUpdate, loc2);
            }
            else 
            {
                loc1.kingwar.sArenaCrossToplists = loc2;
                NetDispatcher.dispatchCmd(ServerCommand.ArenaCrossTopListKingWarUpdate, loc2);
            }
            return;
        }
    }
